import { Entity, AutoIncrementId, PrimaryUuid, Title, Name, Scope, CreateDate, UpdateDate, Code, Link, Uuid, Desc, Jsonb } from "../utils";

@Entity({ name: 'sys_addon' })
export class SysAddon {
    @PrimaryUuid()
    id: string;

    @AutoIncrementId()
    aid: number;

    @Title()
    title: string;

    @Desc({ default: true })
    desc: string;

    @Name()
    name: string;

    @Scope()
    scope: string;

    @Code()
    version: string;

    @CreateDate()
    create_date: Date;

    @UpdateDate()
    update_date: Date;

    status: string;

    @Jsonb({ nullable: true, default: {} })
    setting: any;

    @Code({nullable: true})
    parent: string;

    @Code({nullable: true})
    code: string;
}

@Entity({
    name: 'sys_addon_menu'
})
export class SysAddonMenu {
    @PrimaryUuid()
    id: string;

    @AutoIncrementId()
    amid: number;

    @Title()
    title: string;

    @Link()
    url: string;

    @Name()
    addon: string;
}
